//-----------------------------------------------------------------------------
//	File: mgui_config.c
//	Author: xialing
//		configuration of mgui
//-----------------------------------------------------------------------------

#include "mgui_config.h"

MguiConf_TypeDef *mgui_conf;

//-----------------------------------------------------------------------------
//	mgui_draw_pixel - draw a pixel, mgui api
//		@x: x position
//		@y: y position
//		@c: 0=0; 1=1; 2=inv
//-----------------------------------------------------------------------------
void mgui_draw_pixel(uint16_t x, uint16_t y, uint8_t c)
{
	ssd1306_draw_pixel(x, y, c);
}

//-----------------------------------------------------------------------------
//	mgui_get_pixel - read a pixel, mgui api
//		@x: x position
//		@y: y position
//		@return: pixel state
//-----------------------------------------------------------------------------
uint8_t mgui_get_pixel(uint16_t x, uint16_t y)
{
	return ssd1306_get_pixel(x, y);
}

//-----------------------------------------------------------------------------
//	mgui_init - init mgui
//		@conf: configuration of mgui
//-----------------------------------------------------------------------------
void mgui_init(MguiConf_TypeDef *conf)
{
	conf->xsize = MGUI_XSIZE;
	conf->ysize = MGUI_YSIZE;
	conf->invc = 0;
	conf->font = (MguiFont_TypeDef *)&font_12;

	mgui_conf = conf;
}

//-----------------------------------------------------------------------------
//	mgui_set_invc - set mgui invert color
//		@inv: 1=invert; 0=normal
//-----------------------------------------------------------------------------
void mgui_set_invc(uint8_t inv)
{
	mgui_conf->invc = inv;
}

//-----------------------------------------------------------------------------
//	mgui_set_font - set mgui font
//		@f: font
//-----------------------------------------------------------------------------
void mgui_set_font(MguiFont_TypeDef *f)
{
	mgui_conf->font = (MguiFont_TypeDef *)f;
}
